package top.infopub.mgr.cap.dao;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import top.infopub.generic.GenericDao;
import top.infopub.model.cap.ContractGuarantyDetail;
import top.infopub.model.cap.GuaranteeName;

import java.util.List;

@Repository
public interface ContractGuarantyDetailDao extends GenericDao<ContractGuarantyDetail, String> {

    /**
     * 根据保证合同主表ID查询子表列表
     * @param contractGuarantyId
     * @return
     */
    List<ContractGuarantyDetail> queryListByContractGuaId(@Param("contractGuarantyId") String contractGuarantyId);

    /**
     * 查询担保单位（下拉框）
     * @return
     */
    List<GuaranteeName> queryGuaranteeName();

    /**
     * 批量添加子表
     */
    void insertByBatch(List<ContractGuarantyDetail> detailList);


    int deleteByPrimaryKey(@Param("contractGuarantyId") String contractGuarantyId);

}
